
#ifndef		__WEAPON_H
#define		__WEAPON_H

#include	<list>
#include	<vector>

#include	"Projectile.h"

class Ship;

class Weapon {

	private:
		std::list<Projectile>	projectiles;
		SDL_Surface*			projectilesSurface;
		Projectile				p;
		Ship*					pShip;
		unsigned int			firingInterval;
		int						weaponFireRate;
		bool					enemyWeapon;

	public:
		Weapon();

		enum weaponTypes {
			PULSE_GUN,
			LASER_GUN,
			TRIPLE_PULSE_GUN
		} weaponType;

		enum weaponFireRates {
			PULSE_GUN_RATE = 680,
			LASER_GUN_RATE = 1100,
			TRIPLE_PULSE_RATE = 700
		};

		bool isFiring;

		bool init(weaponTypes w, Ship*);

		void fire();

		void loopProjectiles();

		void renderProjectiles(SDL_Surface*);

		void cleanup();

		void setEnemyWeapon(bool);

		void setFireRate(int);

		void setShip(Ship*);

		void cleanProjectiles(){ projectiles.clear(); }

		unsigned int getNumberProjectiles(){ return projectiles.size(); }

		Projectile*	getProjectile();

};

#endif
